<?php 

//引入头部和常用函数
include_once '../function.php';

//实例化msyqli类
$mysqli = @new mysqli("localhost", "root", "", "school"); 

if($mysqli->connect_errno){
	echo "数据链接失败：错误代码：".$mysqli->connect_errno."错误信息：".$mysqli->connect_error;
}

$mysqli->query("SET names UTF8");    //使编码一致，变成UTF8.


// MySQLi_STMT类（预准备）

$stmt = $mysqli->prepare("insert into stu (name,sex,age) values(?,?,?)");

if($stmt){

	$stmt->bind_param('ssi', $name, $sex,$age);

	$age =18;

	for ($i=0; $i <500 ; $i++) { 
		$name = "小明".$i;

		$sex = "男";

		$age += 1;

		$stmt->execute();
	}

}



//在cmd 里输入这个可以删除测试后的不要的数据
//用id 来判断删除
//delete from stu where id > 15;















 ?>